package com.msh.frame.interfaces;

public interface IdGenerateable {

  /**
   * 获取唯一id
   */
   Long getUniqueId();

  default Long[] getUniqueIds(int count) {
    if (count < 1) {
      throw new RuntimeException("生成id数量必须大于0");
    }
    Long[] ids = new Long[count];
    for (int i = 0; i < count; i++) {
      ids[i] = getUniqueId();
    }
    return ids;
  }

}
